package com.flitsneak.designpatterns.behavioralpatterns.templatemethod;

/**
 * Author: flitsneak
 * Date: 2022/6/6 10:13
 * Description:
 */
public abstract class BPlanTemplate {

    protected abstract String buyFruit();

    protected abstract String buyDessert();

    public void templateMethod() {
        this.buyFruit();
        if (this.isBuyDessert()) {
            this.buyDessert();
        }
    }

    protected boolean isBuyDessert() {
        return true;
    }
}
